<!DOCTYPE html>
<html lang="zh">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>浏览器指纹测试</title>
    <script src="./js/eling.js"></script>
</head>

<body>

    <h1>浏览器指纹测试</h1>
    <h3 id="fp1"></h3>
    <script>
        eling().then(fp => {
            document.querySelector("h3#fp1").insertAdjacentHTML('beforeend', `${fp}`);
            let v = localStorage.getItem("fp");
            if (v && v !== fp) {
                console.log("fp已存在: ", v);
                alert("fp已存在");
                let count = parseInt(localStorage.getItem(v)) || 0;
                localStorage.setItem(v, count + 1);
            }
            localStorage.setItem("fp", fp);
        });
    </script>
</body>

</html>